get values from JSON file by field name - alteryx

We want to store and retrieve variables from a JSON file within our Alteryx workflow. We are able to run it through the Input Data tool, and it previews the data like so:
JSON_Name Json_ValueString
1 BaseUrl {url}
2 Api /api/download
3 UserDirectory {directory}
4 AccessToken {token}
5 DatasetName {name}
So far, so good, but we would like to pull the values from here and use them in our formula.
For example, using Formula tool to concatenate BaseUrl+Api, create the text of the Authorization header by doing "Bearer "+AccessToken, etc.
We can do that with the TextInput tool pretty easily, just by selecting these values from dropdowns, or by using
%AccessToken%
However, that doesn't seem to work the same way with the Input Data.
Is there a way to retrieve fields in a JSON by name?

Related

Use HTTP request to create column with formatting schema in power automate

I am creating columns in SharePoint list with "Send An HTTP request". I am wondering if I can also send formatting column json schema as a part of request content body (or any other way from power automate).
Here's an example of how you can do it in the action you use to create the column, i tried it and it works. I recommend you to configure the JSON custom formatter directly in sharepoint list/library and then minify the code.

How to retrieve the text tab values ordered?

I am retrieving all the text tabs from two envelopes completed. but the values come in different indexes.
I am working in python and used the get_page_tabs function to retrieve it.
both were filled from the same template, and in the document view they are correctly filled, but the get function returns it like that. is there anyway to retrieve it in order? or a way to identify the field I am working with?
You could use the get_form_data() method instead and then parse the JSON that is coming back to obtain what you need. It would look something like this:
tabs = envelope_api.get_form_data(args['account_id'],args['envelope_id'])
while (i < len(tabs.form_data)): print(tabs.form_data[i].name +" "+ tabs.form_data[i].value) i+=1

Get filtered data from Google Sheets API

I am using nodeJS for fetching the data from google sheet and the URL looks like :
var url = `https://sheets.googleapis.com/v4/spreadsheets/${sheet_key}/values/Sheet2!A1:J20?key=${google_API_key}`
From this, I am only getting the data between A1 to J20 So now I have two questions :
How do I get all the rows from the sheet or last 10.
How do I apply a structured query filter like: where name == "Himanshu"
Edited :
For question 2: what I have done is using Query Language Reference (Version 0.7) / structured queries, which is referenced by #Tanaike. This is how my URL looks
like now and its working as well.
https://docs.google.com/a/google.com/spreadsheets/d/${sheet_key}/gviz/tq?tq=select%20*%20where%20B%20%3D%20'Himanshu'&key=${google_API_key}
But the issue is it's returning me the string something like this which I cant able to parse.
google.visualization.Query.setResponse({"version":"0.6","reqId":"0","status":"ok","sig":"509770406","table":{"cols":[{"id":"A","label":"Response Path","type":"string"},{"id":"B","label":"Name","type":"string"}]}})
How about this answer?
A1
You can retrieve all rows using sheet name as the range as follows.
var url = `https://sheets.googleapis.com/v4/spreadsheets/${sheet_key}/values/Sheet2?key=${google_API_key}`
A2
You can use the query like where name == "Himanshu" using Query Language. In order to use this, please share the Spreadsheet as follows.
On Google Drive
On the Spreadsheet file
right-click -> Share -> Advanced -> Click "change" at "Private - Only you can access"
Check "On Anyone with the link"
Click "Save"
At "Link to share", copy URL.
Retrieve file ID from https://docs.google.com/spreadsheets/d/### file ID ###/edit?usp=sharing
About Query Language, you can see the detail information at Query Language Reference.
If I misunderstand your question, I'm sorry.
Edit 1 :
When you want to retrieve the formatted data, please use tqx=out:. In your case, tqx=out:json is used. It seems that it's default. For example, you want csv, it's tqx=out:csv. Also you can use tqx=out:html. I think that tqx=out:csv may be useful for your situation.
https://docs.google.com/a/google.com/spreadsheets/d/${sheet_key}/gviz/tq?tqx=out:csv&tq=select%20*%20where%20B%20%3D%20'Himanshu'&key=${google_API_key}
Edit 2 :
In order to retrieve JSON data of spreadsheet, please do as follows.
On Spreadsheet
Click File -> Publish to the web
Publish as web page.
URL 1
You can retrieve the values of spreadsheet as JSON using the following URL.
https://spreadsheets.google.com/feeds/cells/${sheet_key}/od6/public/values?alt=json
od6 means 1st page of spreadsheet.
URL 2
If you want to retrieve other pages, please confirm using the following URL.
https://spreadsheets.google.com/feeds/worksheets/${sheet_key}/public/basic?alt=json
Note :
If error occurs when you access the URLs, please confirm whether the spreadsheet is published again.

Data Dictionary Storage and Retrieval with MongoDB and Node.js Application

I have the following requirement in my project.
It is a reporting application so mainly will be storing data about my entities once and most of the times will be retrieving it and showing them on the webpage as different reports. I am using node.js and mongodb for this project.
The data is in the form of excel. There are more than 2000 columns and each column has one short code like s0a_1, s0a_2, s1a_1, s1a_2 etc. Each column code is mapped to a long meaningful text. For example, s01_1 -> What is the name of the person ? , s01_2 -> 'Project Name' etc. And for each column there will be a corresponding value which is a number most of the time.
In my reports, I need to show long meaningful text and corresponding value.
So, what is the best way to achieve this ?
We can think of the following ways:
Create a collection in mongo and store shortcode/text as key value pair and each time I replace short code with text before sending response to the client.
Store in a property file as key value pair
Use redis for this specific purpose
Any help will be appreciated.
Thanks.

How to use view parameter "Keys" for date fields at Domino Data Service REST API

Domino REST API doesn't return any view data if I use date at query parameter "Keys". In case of Extension Library REST Control we can use NotesDateTime() or #Date() to make it work.
But I don't know how to use the same at Domino REST API call. Anybody knows how to use date as key?
This is the the sample url,
https://demodomain.com/demo.nsf/api/data/collections/name/viewName?sortcolumn=DateField&keys=1999-03-24T22:16:17Z
I looked at the source code for the Domino data service. The view entries resource (/{db}/api/data/collections/name/{view}) always assumes the keys parameter is a string. So apparently it's unable to match any value in a date column.
This behavior could be improved. Meanwhile, you could work around the limitation by creating a separate sort column with the TEXT representation of the same date. Use the new column name in the sortcolumn parameter and the view entries resource should be able find rows that match the keys parameter.

Resources