Convert x-www-form-urlencoded to json

Options
How do I transform a webhook received in xano from x-www-form-urlencoded format to a json?

Comments

  • Sean Montgomery
    Sean Montgomery Administrator

    ADMIN

    Options
    Hey Mauro,

    That format just means it is arriving to Xano in in the following pattern: name1=value1&name2=value2

    Xano automatically decodes that for you if you specify inputs. If you wanted to convert that to json, then it would be building a new object with key value pairs.

    So lets say you create 2 inputs = test1 and test2.

    Then you would create a new variable called 

    JSON1 = {}
      set(test1, input:test1)
      set(test2, input:test2)

    That would be the pseudocode. There may be an easier way to do this, but I would need an example.
  •  I need to get the input data via Utility Functions --> Get All Input because the structure can be different, so the best solution is to convert to json.