Navigate back to original app after executing LINKTOAPP(app-id) action

In my app, I have a directory of many other apps displayed in a card view. When the user clicks a card, a LINKTOAPP() action is called and takes them to the other app. How do I get back to my original directory app after doing this?

0 8 233
8 REPLIES 8

Roderick
Community Manager
Community Manager

Hi @mithranatkarsun,

You should be able to use the LINKTOAPP() action to take the user back to your directory app. To do this, you would need to know the ID of your directory app. You can find the ID of your app by going to the App Settings page and looking for the App ID field.

Once you have the ID of your directory app, you can use the following formula to create a LINKTOAPP() action that will take the user back to your app:

LINKTOAPP("app_id")

(Where app_id is the ID of your directory app.)

Here is an example of how you could use the LINKTOAPP() action to take the user back to your directory app:

function onCardClick(event) {
  // Get the ID of the app that the user clicked on.
  var appId = event.row.app_id;

  // Create a LINKTOAPP() action that will take the user back to your directory app.
  var action = new Action("Go Back", LINKTOAPP(appId));

  // Add the action to the event.
  event.addAction(action);
}

This code will create a function called onCardClick() that will be called when the user clicks on a card. The function will get the ID of the app that the user clicked on and then create a LINKTOAPP() action that will take the user back to your directory app. The action will then be added to the event.

When the user clicks on a card, the onCardClick() function will be called and the LINKTOAPP() action will be executed. This will take the user back to your directory app.

Hope this helps,

 

Where do I run this Javascript code you have provided? I didn't know Appsheet had a feature to run Javascript, can you provide some resources for me to read on how to use Javascript in Appsheet?

More like Roderick_GPT

Roderick
Community Manager
Community Manager

Thank you for the link. However I am not quite sure how the provided code is going to help me go back from the destination app back to the directory app. I have over 15 destination apps. Do I have to create a LINKTOAPP() action in every single one of those apps to go back to the directory?

Is there a way to set an automation such that when I click on a destination app in the directory, a button is automatically created to go back to the directory inside of my destination app?

"Directory app" sounds like a launcher app.

This way you just click where the "AppSheet Gallery" menu option usualy goes.
This applies to any other deeplink that takes you to other app, you can go back using the menu option.

Create app launchers or launch apps and URLs from AppSheet apps - AppSheet Help

Yes this is exactly how my directory app is currently setup. What if I don't want to click where the App Gallery menu option goes? It is not very obvious to the user that they should click there to go back.

I've run into trying to build this functionality before. There's not a great solution.

Here's the solution that I thought would be optimal, but has a major issue:

Have a user's table that is common to every app (which is already pretty typical). Have each of your navigation actions actually be a grouped action that first sets a value in the user's table, and then navigates to the app. This value provides the context for the other app to know where you take you back to.
The problem being, the nav action happens too fast, before the data change has time to fully sync, so the second app loads without knowing about that new data. ** However, this perhaps is now solvable with quick-sync?? **

 

For the particular situation that I was setting up at the time, the nav to another app was for the purpose of filling out a form to submit a record, then immediately going back to the 1st app. So my solution here was to send that context value in as a LINKTOFORM argument, and actually stored it in the newly-created record, which gave the 2nd app the context needed to navigate the user back to the 1st app. Of course this only works if you're using LINKTOFORM.

Top Labels in this Space