Clickable list from JSON Data

Hi

I am building a list of KPI’s for a staff member performance review.

I am using AI to make suggestions for KPI measurements based off a job description.
I have set up the AI to return a maximum of 10 “suggestions” and also have the results returned in JSON format.
I now have a nice organised / presented list of suggestions.

What I want to be able to achieve now, is to present this list in a collection so that if the user wishes to include a suggestion in the actual KPI list that they are building, clicking the item will add a row to the appropriate table and add the appropriate values.

Possible? Appreciate suggestions. (PS. True No Coder here so please keep it simple :slightly_smiling_face:

I looked at extracting values using Query JSON but I cannot do this dynamically. I would need to build out 30 columns to extract the 3 field values for each of the 10 “suggestions” and I am not sure that is worth the effort for what I am trying to achieve.

Sounds like it!

Some screenshots of your app setup would help, too.

Specifically how your data tables and custom actions are configured. :slight_smile:

Thanks Andy

Think this will illustrate what I am trying to achieve.

Role Table

KPI’s Related to Role

Action to Generate KPI Suggestions

Front End Goal

I hope that is not confusing!

Happy for any guidance as to correct approach.

You should have a helper table.

  • On entry to the Roles row, set the rowID of that role to a column in your user profiles table.

  • Get a relation & lookup on the user profiles side to retrieve the suggested KPI JSON from the row you’re viewing.

  • Add a new helper table, add 10 rows to it.

  • Add a rowID column to the helper table.

  • Add a lookup pointing to that rowID columns, basically getting all rowIDs in an array.

  • Add a find element index column, find the current row’s rowID from the array of rowIDs. This will essentially give you an index.

  • Build out a template column using the JSONata format, using the index we just had above.

Say for $.metrics[0] you will get a JSON of the first task in your parent JSON. The template should be: $.metrics[{I}] with I being the index.

  • Add a query JSON column to query the parent JSON with the template you just build.

  • Add 3 columns of query JSON to get the corresponding name, criteria & goal.

Then you have them all lined out correctly, it’s just a matter of adding an add row button when users view these, to add the extracted name, criteria & goal to the KPI table.

3 Likes

@ThinhDinh So appreciated! Works just as expected.

I had already built the helper table but the key for me was how to dynamically query the JSON and your solution provided the answer:
CleanShot 2024-06-12 at 18.34.14

Thanks again for the time and energy.
CleanShot 2024-06-12 at 18.39.04

1 Like

Great to see!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.