Hi there AppWorks fans,
Welcome to a new installment of AppWorks tips.
Now and then I hear something or read something, I add it on my backlog items to give it shot trying it out myself, but mostly so many things get in between that trivial things get lost in the bulk. After restructuring the backlog, this item passed my path again, and this time we take a moment to cover it in a post. It’s a small thing but can have a profound impact in your thinking process on implementing things.
Let get right into it…
What small thing am I talking about? Well, it’s the URL parameter ?rurl=
. Nice, but what can we do with it and how do we use it? All valid questions! Watch and learn but comment me when you see more use-cases…I’m curious!
You can read about this parameter in the low-code guide too; See section “Creating a form”. Or search for
rurl
.
I don’t know if you ever noticed, but when you create a new ‘Create’ form on an entity, you see this view:
The red arrow shows you a direct link to the ‘Create’ form for this entity (like you can also see on a layout!). Publish the entity and move your browser into runtime with this URL:
http://192.168.56.107:8080/home/appworks_tips/app/start/web/perform/create/080027f2140da1ef9884efe770aeaf49
What will we see? Exactly!…Our ‘Create’ form…standalone! NICE! 🤗
People with close attention, see that the URL points directly to the ‘TypeId’ of the entity template, not the ‘ItemId’ of an entity instance!
Right, so what if we hit ‘Cancel’ here? Well, it forwards to this URL: http://192.168.56.107:8080/undefined
“Undefined”? What is undefined here? Well, how about the redirection URL (rurl
!). Let’s update the initial URL: http://192.168.56.107:8080/home/appworks_tips/app/start/web/create/080027f2140da1ef9884efe770aeaf49?rurl=home/appworks_tips/app/start
Now, after ‘Cancel’ or ‘Create’ it forwards/redirects to the normal end-user URL…
FYI: When you open this URL in a new incognito tab (without a session yet), you’ll first get a login screen!
All fascinating, but what use-case does this solve? The documentation is telling me that external applications can now easily “embed” this in their application, but how “easy” is it really. Maybe if you have Single Sign On implemented? But where do you point to as redirection as it can only redirect to a relative path within the same application server! Redirecting to home/appworks_tips/app/start
is not especially useful…correct?
…
AHHHHH WAIT…We need to “see” this from the perspective of the external application server! There you can off-course redirect to a web context within that server! Yes, sometimes the penny must drop first before you can clearly see it! 😏
Testing time
Now for some tests; These all respond the same:
1 | ?rurl=home/appworks_tips/app/start |
Only ?rurl=/
will return to the root: http://192.168.56.107:8080/
Leaving it empty, ?rurl=
is giving a strange behavior with an empty screen (only AppWorks background in my case), but I also saw other behaviors like picking up my previous tryout or loading the regular UI. Strange…Looks like you always want to have a relative path behind it!
Q/A time
During playtime, I asked myself these questions:
❓ Can we now “after creation” create a second entity and reuse data from the previous creation? So, that’s creating a generic ‘Case’, selecting a specific process and open the create screen to for a specific case?
Great thinking, but after evaluating this principle with an action type of ‘Rule’ BB I got stuck in nasty screens. Try it yourself:
Adding an extra
&rurl={system.baseURL}app/start/web/create/080027f2140da1ef9884efe770aeaf49
gets things even nastier.
❓ Can we now create a wizard kind of action-flow like explained in this post? Well, I don’t think so!
❓ I see these paths passing by /create
, /perform
, /item
; What else? 🧐 I leave that question with you!
That’s a nice secret “DONE” where we gain knowledge about the ?rurl=
redirection parameter in an AppWorks URL. You see that listening, reading, and focusing brings you to unusual places of the platform. I’m still amazed about the possibilities after all these years and still I see new things weekly. I keep on sharing them, you keep asking your questions and that’s exactly how we grow all together. Have a great weekend and I see you next week.
Don’t forget to subscribe to get updates on the activities happening on this site. Have you noticed the quiz where you find out if you are also “The AppWorks guy”?