Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
RolfG
Contributor II
Contributor II

How to get an e-mail adress of a user invoking an automation

Hello everyone,

I would like to link an automation, creating a report and sending it to an e-mail address to an app.

By invoking the automation, the current users mail address should be retrieved and inserted as receiving address in the Send mail block.

Is that possible? I'm having trouble to find something about this for Qlik Enterprise SaaS.

 

Thanks for you response.

Labels (2)
1 Solution

Accepted Solutions
salmankojar
Partner - Creator
Partner - Creator

hi @RolfG for triggering through Qlik App Button. you need to follow below steps:

1. Create a variable vUserIDP in App Front end to store Current User who is triggering the button of Automation. 

vUserIDP =Subfield(OSUser(),'=',-1)

2. Create another variable vU ser with no defintion. just create and keep it empty.
3.Create a button and give below actions in order mentioned below.
    Action1 - set variable Value as shown in image( value = ='"'&vUserIDP&'"' )

           salmankojar_1-1723464674398.png

  Action2 - Execute Automation with below options enabled.

            salmankojar_2-1723464885377.png

4. Click on Copy Input Block Button and go to your Automation and paste the blocks below the start block of your automation.

5. After Copying the above blocks please check the attached automation to get the user email.

 

 

View solution in original post

7 Replies
salmankojar
Partner - Creator
Partner - Creator

Hi @RolfG you can use the Automation Json attached here for your requirement. Use the variable i created for recipients list as per your need for all users in your tenant.If you want the current user running the Automation then you can use GET CURRENT USER block of QLik cloud services.

If you want to trigger the automation from the app then you need to create a variable in the app that stores the subject id in that and then you need to fetch the value of that variable in the automation to get the email id by using that subject.

RolfG
Contributor II
Contributor II
Author

Hi @salmankojar 

thank you very much for your response. I've tried to use the new GET CURRENT USER ID first, than GET USER and in the SEND MAIL block I can extract the mail from the user object.

RolfG_0-1723454755152.png

 

The output in the history looks ok, but initiating the automation by an other user results in sending the output to my mail adress. Either GET CURRENT USER ID does not work properly at that time (because it is experimental)  or there is something about caching the information or my sequence is wrong. Concerning the caching, I'm unsure about is, what settings I should use for caching (None, end of automation or a specific time).

Sequence of my automation looks like this:

RolfG_1-1723455867144.png

 

 

salmankojar
Partner - Creator
Partner - Creator

Hi @RolfG How do you initiate the Automation? Through Qlik App or any other way?

 

RolfG
Contributor II
Contributor II
Author

I want to initiate it by a button from within a qlik app

salmankojar
Partner - Creator
Partner - Creator

hi @RolfG for triggering through Qlik App Button. you need to follow below steps:

1. Create a variable vUserIDP in App Front end to store Current User who is triggering the button of Automation. 

vUserIDP =Subfield(OSUser(),'=',-1)

2. Create another variable vU ser with no defintion. just create and keep it empty.
3.Create a button and give below actions in order mentioned below.
    Action1 - set variable Value as shown in image( value = ='"'&vUserIDP&'"' )

           salmankojar_1-1723464674398.png

  Action2 - Execute Automation with below options enabled.

            salmankojar_2-1723464885377.png

4. Click on Copy Input Block Button and go to your Automation and paste the blocks below the start block of your automation.

5. After Copying the above blocks please check the attached automation to get the user email.

 

 

RolfG
Contributor II
Contributor II
Author

Hi @salmankojar ,

thank you very much for your anwser. Before I mark your anwser as a solution, please correct one thing, so that others can learn from it. 🙂

  1. In "Action1 - set variable Value as shown in image( value = ='"'&vUserIDP&'" )" the variable name should be vUserSubID enclosed by '"' (there is one missing at the end)

I had to delete the Block GET CURRENT USER ID and select the User from the result of the new INPUT Block as input to the GET USER block.

That worked

salmankojar
Partner - Creator
Partner - Creator

Hi @RolfG  Thankyou for reminding the typing mistakes..actually i was doing other work side by side.i have corrected the mistakes.i hope i have solved your problem.