You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Is there a way to get a list of the pages in the current space using a REST API?
Why, you may ask?
My customer wants to be able to create a page using an IFTTT macro using a template. If there's already a page with that same name within that same name, they want to flag an error before the page is created. They use a ConfForm to create the page, then I delete the form once the page is created. However, if a form with that same name exists within that space, the onCreate will fail. They want a way to check the uniqueness within the space before that, so that the onCreate doesn't fail. Is there a way to do that from the IFTTT macro? I was thinking a REST API would do the trick.
Thank you in advance!
Guess the search endpoint should do the work. You could just send a CQL filtering for the specified space:
They don't want the data from the ConfForm stored. They want to use it to create the page, then delete the entry. I explained that normally I would put a validation rule on the ConfiForm field for uniqueness. However, that won't work because they don't want to keep the entry. Then asked the following:
Can the IFTTT check of the page exists right after the users enters the name, before entering any the other information? And if the page exist, pass an error message. If the user tries to create a new page with the same title as an existing page, do not overwrite the existing. The system should create a hard edit: “This item has already been entered. Please verify the name or make updates to the existing item."
The error occurs with the IFTTT macro onCreate, when the page title already exists in the space. I tried it. The page simply doesn't get created, and the ConfiForm entry is still there. I can remove the entry - that's not a problem. If you know another way to check for the existence of the page name within that space either with a Rule or on the Submit, I'm all ears!
Thank you in advance.
You can set up a form to remove the entry onError (IFTTT to delete an entry, set onError event with a filtering expression set to something like id:[entry.id] to delete the current record only) - so there is nothing left after the failed try.