Hi Guys,
I have a big table, where there is a if-else-if column which is true for certain condition and false for others.
I am using big table so that API will give me list of Names for which this if-else-if condition is true.
But I dont see Show API listing this if-else-if parameter.
Is there something I am doing wrong? Or what is a workaround?
Regards,
Dilip
Computed columns are not available via the API, for any data source.
Oh ok @Darren_Murphy
I have a requirement where I check data difference and if data difference is greater than 7 days I want data to be fetched for that particular row item
So I need to only send this item in my get api
Is there any way I can do this?
using if-else-f is out of question
Regards,
Dilip
Assuming that you have the date in a non-computed column, couldn’t you just calculate the date 7 days ago, and then use that date as a filter in the API query?
Hi @Darren_Murphy ,
Thank you for replying.
I am not following your point.
I have column called LastUpdatedDate which is date and time column. Every time new data is fetched the LastUpdatedDate column is updated with latest date
how do I do this?
Regards,
Dilip
Where are you sending the API call from?
Hi @Darren_Murphy ,
I am using glide API to send the list of creators and their profile link.
The external source checks the profile links and sends back values to my glide table.
When it does they also update LastUpdatedDate column with latest date.
That’s how I am fetching lastupdateddate currently.
Regards,
Dilip
I thought you were querying the Glide API?
It’s using glide API itself.
Regards,
Dilip
I am using glide api itself to send the list of creators
Using glide big table
They they use glide edit api to send me data back.
Regards,
Dilip
Okay, the below confused me…
Anyway, assuming I’m now understanding correctly, what you could do is take an extra Joined List of the Date column, and then use that in the JavaScript, excluding those rows that don’t meet the criteria.
Hi @Darren_Murphy ,
Can I then pass it in my get api request to get only that list ?
In my api response
Regards,
Dilip
I have absolutely no idea what you mean by this, sorry.
Hi @Darren_Murphy ,
Good day!
Sorry what I meant is
I have a list of creators in my Big table. I will Need to send a filtered list of creators using the Glide API.
ok So you are saying I create a joined list of Date.
Then write a java script that picks dates which are more than 7 days and →
I am using the below JS and get the output where it says fetch for number of dates which are more than 7 days. But same results are printed in every column
Like if I have 3 dates more than 7 days
It says Fetch,Fetch,Fetch
Even if I get a row to output Fetch by comparing dates, how can I pass the filtering criteria in my Glide api request? Dont think Javascript column output comes in postman Get api request of glide api
// Check if p1 is defined and not empty
if (typeof p1 !== 'undefined' && p1 !== null && p1.trim() !== "") {
// Assuming p1 is a joined list of dates in 'DD MMMM YYYY at HH:mm' format, separated by commas
var dateList = p1.split(","); // Split the joined list into an array of dates
var currentDate = new Date(); // Get the current date
// Initialize an array to store the results
var result = [];
// Loop through each date in the list
for (var i = 0; i < dateList.length; i++) {
// Remove "at" and trim extra spaces, then convert to a date
var inputDateStr = dateList[i].replace("at", "").trim();
var inputDate = new Date(inputDateStr); // Convert the string to a date object
// Calculate the difference in time (milliseconds)
var timeDifference = currentDate - inputDate;
// Convert time difference to days
var dayDifference = timeDifference / (1000 * 3600 * 24);
// Check if the day difference is more than 7 days
if (dayDifference > 7) {
result.push("Fetch"); // If more than 7 days, push "Fetch"
} else {
result.push(""); // If not, push an empty string
}
}
// Join the results back into a string separated by commas and return
return result.join(",");
} else {
return ""; // Return an empty string if p1 is undefined or empty
}
I am getting in the column Fetch for each rows which have date different more than 7. But all rows have same value. How can I make sure that Get api of glide only sends those which have more than 7 days.
Confused with the last part
Thank you in advance,
Regards,
Dilip
Hi @Darren_Murphy ,
From my understanding even after I get out put of JS
any manipulation I have to do to get data will be on a computed column which does something to get me required data or JS column
Which is not printed in the response of Glide API. as Glide API does not support JS or computed columns in the response
Are you saying I make use of Zapier or make to write this output into text column ??
Sorry if I sounded stupid , Thank you in advance
Regards,
Dilip
Hi Guys,
Any help/suggestion on this?
Thank you in advance for help.
Regards,
Dilip
Hi @Darren_Murphy ,
I am not quite sure that I can still get the filtered response here because JS column is a computed column right?
Thank you.
Regards,
Dilip