Hey all,
Just an update to let you know that my favourite Swiss army knife style component, aka the "Create Lookup table" action, is having some improvements shipped this week, of which there are three changes coming.
Firstly, the .get method will try really hard to map your key to the right value. As an example:
The first row is "5" mapping to "hello". You would need to provide a string value of "5". If you used a number field or the results of a math operation that wasn't then turned into a string, you wouldn't get a result. As an example, this would not work:
{{example.get(5)}}
But this would:
{{example.get("5")}}
This has now been fixed! Yay!
But it has also been supercharged as well. The .get method can now sometimes figure out when you're using a value that cannot work, such as issue or assignee:
{{example.get(issue)}}
{{example.get(issue.assignee)}}
Neither of these would work as you cannot make an issue object a key nor a user object. Instead, the .get method will use the display value instead. What do I mean by that? Well, if you did a Log Action and logged out {{issue}} you'd see the issue key, eg RAGE-234, or in the case of {{issue.assignee}} you'd see the account ID. The .get method will now try that instead.
There is a new method called .size which will tell you how many rows are in the table:
{{example.size}}
A few people had asked to be able to get the rows in the table as a list. You can now do that with the .entries method:
{{exampple.entries}}
which returns a list of pairs. For the above example you would get:
key=5,value=hello
key=RAGE-234, value=bananas
key=RAGE-7996, value=First
key=RAGE-7997, value=Second
If you wanted to show all the keys you could do a log action with the following smart value:
{{example.entries.key}}
We've upped the limit on the number of rows in the table to 200. So the table will now be paginated at 20 rows per page!
These changes will start rolling out over the next week. Big thanks to @Julia Foden and @Bill Sheboy for their help with the changes!
Happy automating folks!
Simmo
42 comments