Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have a variable defined in the document properties with the following value, which gets the value of the selected ReportName and is used in a show Condition.
=FIELDVALUE('ReportName',FieldIndex('ReportName',GetFieldSelections(ReportName)))
I tried to move this to the load script but it fails on the 'GetFieldSelections' function.
I read some other posts and it seems as though I need to do a set analysis but dont really understand how to actually do this.
Can anyone help me with this? Thanks.
How are you defining the variable in the Load Script?
If you use:
Let vVariable = FIELDVALUE('ReportName',FieldIndex('ReportName',GetFieldSelections(ReportName)))It should give you the same result as if you defined the variable manually in document properties. "Let" is the key when you have a variable that is an expression and you don't want it to be evaluated at runtime.
Yes,
Thats what I had. ReportName is a table built as inline and is defined before this variable. I dont know if that helps.
Here is the error I get when I try to 'reload' the script.
Error in expression:
GETFIELDSELECTIONS is not a valid function
Let vVariable = FIELDVALUE('ReportName',FieldIndex('ReportName',GetFieldSelections(ReportName)))
SET ThousandSep=','
Try:
Set vVariable = "=FIELDVALUE('ReportName',FieldIndex('ReportName',GetFieldSelections(ReportName)))"I think I misspoke about Let. It seems like you need to use Set here. Maybe Let does evaluate at run-time. Now I've confused myself. ![]()
That worked to get the variable set to the that string representation of the expression that I want. Now the question is, how do I get that expression to evaluate?
Thank you again for all your help. This is definitely appreciated.
=vVariable as an expression. In some cases, you may need a dollar sign expansion: =$(vVariable)