Look-up list

Describe the issue/error/question

I’m trying to do a look-up within a list.
Concretely, I have a defined list of 4 roles:

  1. Admin
  2. Marketeer
  3. Editor
  4. External User

That information, I get from a webhook.
My next step is to push data into another tool. There the mapping is the following:

  1. admin
  2. marketeer
  3. editor
  4. external_user

What is the best way for me to do that, which node type should I use? The “Set” doesn’t seem to be doing that job.

Hey @Olivier_de_Lamotte,

I would have thought the Set Node would be great for this, What does your set node look like and what is the output looking like?

I take it there is more to it than just changing the case and replacing the space with a _?

Hi,
How would you define the name/value then in the ‘set’ node?
I’m not sure how to set it up actually as I don’t know what the input value will be.
It’s not just lower casing it indeed, it’s an example here and sometimes I have a mapping table that translates IDs to a string.

I’m putting this screenshot but I doubt it’s actually helpful so far.

Thanks for the help!

Hey @Olivier_de_Lamotte,

So it sounds like there is a bit more to it then :slight_smile:

Can you share the data and what you are expecting out of it, The original post was missing some potentially useful information.

Sorry if it could have been more complete before and thank you for your patience :slight_smile:

So this is an example of incoming payload

[
  {
    "body": {
      "firstname": "Jean",
      "lastname": "Dupont",
      "email": "[email protected]",
      "QM_language": "FR",
      "QM_userRight": "External User",
      "QM_user": "Yes",
      "persona": [
        "User",
        "Sponsor"
      ],
      "userHubspotId": 276351,
      "companyPlanhatId": "5e62750a0250e7499f58c6e1",
      "companyName": "Test company"
    }
  }
]

What I’m expecting is:

[
  {
    "body": {
      "firstname": "Jean",
      "lastname": "Dupont",
      "email": "[email protected]",
      "QM_language": "FR",
      "QM_userRight": "external_user",
      "QM_user": "Yes",
      "persona": [
        "User",
        "Sponsor"
      ],
      "userHubspotId": 276351,
      "companyPlanhatId": "5e62750a0250e7499f58c6e1",
      "companyName": "Test company"
    }
  }
]

But you can change the value of the QM_userRight by the following incoming values

  1. Admin
  2. Marketeer
  3. Editor
  4. External User

and they should be in the output as these ones:

  1. admin
  2. marketeer
  3. editor
  4. external_user

Hoping it’s a bit clearer for you :slight_smile:

Hey @Olivier_de_Lamotte,

Just for fun I have done a simple version using a set node that just does the to lowercase and replaces the space with an _, I have also created a mapping table using a set node and used a code node to replace the values which sounds like what you are after.

Let me know if you have any questions on this one.

Thank you Jon,
Appreciate it! This is working, but I believe there is something to do as “standard node” as well as I use this in most of my automation :slight_smile: , will visit the “Feature suggestion” page for it!
Cheers!
Olivier

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