Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
chriys1337
Creator III
Creator III

Formula in a Script Variable

Hi,

I am trying to put a  formula into a Variable (in the script), but the generator puts out an Script Line Error:

LET vL.FieldSelection_Plus1='=if(right(GetFieldSelections(Selection),2)= '51' or right(GetFieldSelections(Selection),2)= '52', left(GetFieldSelections(Selection),4)+1 &'01',GetFieldSelections(Selection)+1)'; // 2. Kickout, -2 to +1 from Selection 

In a Textbox this script works, but how to put it in a variable in the script?

I am happy for any hint.

Kind Regards,

Chris

1 Solution

Accepted Solutions
sunny_talwar

May be try with SET instead of LET

SET vL.FieldSelection_Plus1 = =if(right(GetFieldSelections(Selection),2)= '51' or right(GetFieldSelections(Selection),2)= '52', left(GetFieldSelections(Selection),4)+1 &'01',GetFieldSelections(Selection)+1);

View solution in original post

3 Replies
Anil_Babu_Samineni

May be this?

LET vL.FieldSelection_Plus1 = if(right(GetFieldSelections(Selection),2)= '51' or right(GetFieldSelections(Selection),2)= '52', left(GetFieldSelections(Selection),4)+1 &'01',GetFieldSelections(Selection)+1);


Then create text object and use $(vL.FieldSelection_Plus1) and then see

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
sunny_talwar

May be try with SET instead of LET

SET vL.FieldSelection_Plus1 = =if(right(GetFieldSelections(Selection),2)= '51' or right(GetFieldSelections(Selection),2)= '52', left(GetFieldSelections(Selection),4)+1 &'01',GetFieldSelections(Selection)+1);

chriys1337
Creator III
Creator III
Author

I did it like you suggested, without '' (comma)  and with the SET command. It works in the frontend with a textbox with =vL.FieldSelection_Plus1

Very strange, I thought SET is not computing ... and would need $(), but somehow it works without...