Hi, Im trying to set a variable based on the content of a textinput. I have the textinput default set to a Image control which returns the base64. Rather then put all the base 64 in below. Is there a way i can shorten it up with, If(Startswith(TextInput10.Text, "data:image/svg+xml", Set(Var......?
If(TextInput10.Text = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNv........", Set(VarPDFImage2, JSON(Base64_Blank.Image, IncludeBinaryData)), Set(VarPDFImage2, JSON(Base64_Img2.Image)))
Hi , @Matt383
It seems work good in my side ? Can you show a screenshot what the value return in your side after you click the button?
Best Regards,
Yueyun Zhang
I want the VarPDFImage2 to set to a blank image (Base64_Blank.Image) if the Textinput10 starts with "data:image/svg+xml"
If the TextInput10 starts with anything else, i want the VarPDFImage2 to set the image to Base64_Img2.Image
Hi , @Matt383
What do you want to set to the VarPDFIMage2? In my side , it can return value:
Best Regards,
Yueyun Zhang
No errors with the code however the variable is not working anymore (The set VarPDFIMage2, JSON(Base64_Blank.Image.....)
Hi , @Matt383
Please try to use this code:
Best Regards,
Yueyun Zhang
Invalid number of arguments: received 4 expected 2
Hi , @Matt383
Sorry , what do you mean that "receive arguments" , can you show your screenshot and give me an example what you want to get in your side?
Best Regards,
Yueyun Zhang
Hi Yueyun, yes. I have already tried
If(Startswith(TextInput10.Text, "data:image/svg+xml", Set(VarPDFImage2, JSON(Base64_Blank.Image, IncludeBinaryData)), Set(VarPDFImage2, JSON(Base64_Img2.Image)))
however receive arguments
Hi, @Matt383
Do you mean you want to use the startswith() function as the judgement?
If(Startswith(TextInput10.Text, "data:image/svg+xml", Set(VarPDFImage2, JSON(Base64_Blank.Image, IncludeBinaryData)), Set(VarPDFImage2, JSON(Base64_Img2.Image)))
Best Regards,
Yueyun Zhang