New Bug Encountered: The given key was not present in the dictionary

I have a workflow to save a file.
In the File Name Prefix I had this formula and it was working for some months:

<<Titel>> <<SUBSTITUTE((IF(ISBLANK([Wohnung]) , [Kunde].[Kunde] & " " & ANY(SELECT(Verwalter[Nachname] , IN([Key] , SELECT(Ansprechpartner[Ansprechpartner] , AND( ISBLANK([Wohnung]) , [Kunde] = [_THISROW].[Kunde] , IN([Funktion] , LIST(Mieter , Eigentรผmer))))))) , [Wohnung].[Wohnung] & " " & ANY(SELECT(Verwalter[Nachname] , IN([Key] , SELECT(Ansprechpartner[Ansprechpartner] , AND([Wohnung] = [_THISROW].[Wohnung] , IN([Funktion] , LIST(Mieter , Eigentรผmer))))))) & " " & IF(ISBLANK([Wohnung]) , INDEX(SPLIT([Kunde].[Adresse] , ",") , 1) , INDEX(SPLIT([Wohnung].[Adresse] , ",") , 1)))) & " " & [Anlagenkomponente].[Produktbezeichnung gesamt] & " " , "/" , "_")>>_<<PDF>>

Now I wanted to change the formula and went into the Expression Assistant.
Without changing the formula the editor says:

could not be parsed due to exception: The given key was not present in the dictionaryโ€ฆ

The same formula is working in a VC. (of course without the <<>>)
So I created a VC [Prefix] and use this VC in the File Name Prefix.

But perhaps you can take a look.

Solved Solved
0 16 1,498
1 ACCEPTED SOLUTION

My original Post seems to be fixed. Thank you.

View solution in original post

16 REPLIES 16

Steve
Platinum 4
Platinum 4

Is โ€œTitelโ€ correct?

Im getting this bug too

2X_7_706aebefebeef3651fccadb3ddbd52638f5d89b7.jpeg

According to the documentation here, this should work

That document is for template files, not expressions in the Expression Assistant. Routing <<OrgUnit>> is not valid in either template files or expressions. The error message reflects this, just not clearly.

I respectfully disagree. I am not referring to the content of the template file, but the filename of the file generated when the template is filled out (which is working perfectly, by the way). Hence โ€œFile Name Prefixโ€. And the help page I linked to specifically indicated that it should be possible to use expressions of <> in name of the file. See screenshots below:

Routing <<OrgUnit>> is not a valid expression, nor is it what the screenshot you provided shows. The expression in the screenshot, CONCATENATE("Routing", [OrgUnit]), is valid.

Dear Steve

Please see this help article, second half of the page:
https://help.appsheet.com/en/articles/2848415-creating-and-saving-a-file-from-a-workflow-rule-or-sch...

When I use the column name โ€œ[OrgUnit]โ€ the value does not appear in the filename when the report is actually generated. Although when I test the expression โ€œCONCATENATE(โ€œRouting_โ€, [OrgUnit])โ€ in the expression builder it tests correctly.

You already know what happens when I use the angle brackets, as directed by the AppSheet help article.

Its a bug.

So, I noticed that the documentation for File Name Prefix was changed so that now it reflects how appsheet actually works (aka, a bug). Were you the one to change the documentation @Steve?

It would have been nice for you / appsheet to say โ€œyes, its a bugโ€ or โ€œwe got the doc wrong and weโ€™re going to change itโ€

There is still a bug in File Name Prefix.

When I use the column name, it does not appear in the name of the file when the report is generated.

When I test the expression CONCATENATE ( โ€œSomeName_โ€, [ColumnName] ), the [ColumnName] appears in the test expression. But it does not appear in the report name when the report is generated. See video below:

2X_9_9b76174cf5a942d60aa640a951f4a9e9121d890a.png

I was the one that updated the docs because they didnโ€™t match the current behavior. I will update them again to show a better example, but the (admittedly overly-complex) behavior we have currently is that you can still use the angle-bracket syntax but you need to use an expression to generate it. So for example, "SomeName_<<ColumnName>>" works but SomeName_<<ColumnName>> will not.

Im sorry, but Ive tried various combinations (as you can see in the next video) and I cannot get it to work. I dont want an overly complex expression in the filename, just the column that represents the organisational unit.

The file contains GPS coordinates for different organisational units, and it is the input file to a Google Apps script that will plan routing. Since each org unit covers a different geographical region I cannot use a generic filename.

CloudApp

I understand this is confusing because there are two-level on expressions, but try your first example "StartStopPoints<<OrgUnit>>" on creating a real file (you can use the test button on the workflow) and that should work with the correct file name. The test button you used is only to test the expression.

Below is where the run/test button I encourage you to try is located:

I havent tried it yet, but no can do. I notice from the screenshot you posted you suggested generating the file from Worflow tab -> Save File option. As far as I know the File Name Prefix from here has always worked. But trying from the Reports tab -> Save File option gives the problem. I am trying to generate a JSON file from two different unconnected tables. Workflow Save File only allows access to one table, but at least I can define the trigger, in Reports Save File I can specify which tables the template runs on, but it runs on a time-based schedule.

Let me see if I can figure out another way to achieve the (sub)goal of generating an input file.

Hi David,

If I understand you latest post correctly, you are saying:

  1. In a โ€œSave Fileโ€ Workflow Rule you can refer to a field name when specifying a โ€œFile Name Prefixโ€ expression.
  2. In a โ€œSave Fileโ€ Report you cannot refer to a field name when specifying a โ€œFile Name Prefixโ€ expression.

That is correct, because in a Workflow Rule there is a โ€œcurrent recordโ€. The โ€œcurrent recordโ€ is the record that is being added, updated, or deleted. It is the record that triggered the workflow rule. When you refer to a field in the โ€œFile Name Prefixโ€ expression, the field name and the field value you are referring to is coming from the โ€œcurrent recordโ€.

For a Report there is no โ€œcurrent recordโ€. The Report is triggered by the scheduler but there is no โ€œcurrent recordโ€. The Report always starts โ€œde novoโ€ with no โ€œcurrent recordโ€. As a result, you cannot refer to a field name or field value in the โ€œFile Name Prefixโ€ expression from the โ€œcurrent recordโ€.

This difference between Workflow Rules and Reports also affect how you write templates. Since a Workflow Rule has a โ€œcurrent recordโ€, your template can refer to field names and field values from that record in you Workflow Rule template.

By contrast, in a Report template there is no โ€œcurrent recordโ€. Your Report template must begin with a Start expression that retrieves the record or records you wish to display.

In your report, it might be possible to write an expression that retrieves the โ€œOrgUnitโ€ by some means. However, that expression cannot assume that it is starting from a โ€œcurrent Recordโ€, because there is no โ€œcurrent recordโ€ for a Report.

Ok, thanks for this answer. What you said makes sense. I have indeed found a resolution, using the Workflow Rule and a json template. However, I make use of <> and <> tags to cycle through all the relevant records in on the trigger table, then I use a SELECT to fetch a single row with org unit info from a different table. It works quite well.

My original Post seems to be fixed. Thank you.

Top Labels in this Space