Is there a way to get the map transform on a tag so I can map all 1000 variations of a tag I am reading as input to multiple columns of outputs?
And how so I easily access those outputs?
Here is what I am trying to do.
I am working in perspective on some pages.
I have a tag that gives me values 1-1000, a code
I need to interpret those values into either a 1, 2, 3, or 4.
I think that after I have these mapped, I will have to map another 1000 sets of text to the 1000 values.
Might even have to map two sets.
So I thought the transform in the tag bindings is really nice as it has multiple columns for mapping.
I will need to place labels that read the text fields when these codes come up.
I will need toggle some graphic visibilities when the 1-4 numbers come up.
I think I can possibly use the regular binding transform for this mapping.
I just am not sure how it will work, or if there is a better way.
Like I could hit the plus sign 1000 times and type each entry from my spreadsheet to the mapping.
I just would prefer if I could do some copy and pasting instead.
This is just the first of many machines.
I’d probably put all this mapping logic into a script module and then use a script transform to just call those functions and ask for the transformed value.
Is this the way to test?
I make a script in the project library with the mapping.
I make a label for the text.
In the label for the text, I bind the text with a script that calls my script with the tag for the code as a parameter.
Then I see if the value is written to the label correct?
I think the spots I will need help with are like where to put the script.
I think it goes in a folder in my project library.
I have many machines, so I am going to watch the script video again.
I don’t see a way to make folders for my scripts to separate them for the machines.
I see script packages, but I don’t know what that means so I will do some research and then test.
Thanks for the help. I will update when I have tested.
I think you are asking me specifically about my dictionaries.
I am making a dictionary for each of the different things associated with my code (number that means a lot of things) despite knowing that I could make a dictionary of lists for each code.
I have a code come in.
I use the dictionaries for different sets strings and numbers.
I some strings in different spots.
I use the numbers to then change some images and references associated.
I used some of the numbers different spots.
If you are asking in general, then a dictionary can be a dictionary of dictionaries, integers, strings, or lists.
I think of it is kind of like linked lists.
Did you have some feedback for me or ideas you meant to suggest?
Did I answer the question adequately?
I think what @drastura is getting at is that if your pattern is consistent, you can easily reduce it to a general algorithm; the modulo operator is your friend here, e.g.:
I am thinking about receiving all my faults as a number and then using a dictionary to produce the text for the fault code.
I need help to understand how this will impact the server. If the dictionaries are in the project library, and the calls are on perspective pages, is that a lot of work for the server compared to another way?
Is it better to set the message to a tag first, and then use the tag in the views?
If so, how do I pull that value from the dictionary into a tag?