Skip to main content
Solved

Context substitution variable in workflow/BPA


Asheer
Do Gooder (Partner)
Forum|alt.badge.img+2
  • Do Gooder (Partner)
  • 4 replies

Hello,

I am trying to update a custom field on a custom page on IFS Cloud using workflow/BPA.

The value needs to be set to the current user Id.

Is there a way to get the current user Id by using a context substitute variable(#USER_ID#) in the value field?

I am using  - IFS Aurena client version: 21.2.1.20211105061905.0

Thanks in advance,

Asheer.

Best answer by ChamariJ

Hi Asheer,

I had a same requirement to get the current logged in User-Id for a validation. I was able to read user id using a IFS Projection like below. Variable “Identity” returns the current User-Id.

 

Hope this will help you 😊

Cheers!
Chamari

View original
Did this topic help you find an answer to your question?

19 replies

ChamariJ
Sidekick (Partner)
Forum|alt.badge.img+4
  • Sidekick (Partner)
  • 6 replies
  • Answer
  • August 5, 2022

Hi Asheer,

I had a same requirement to get the current logged in User-Id for a validation. I was able to read user id using a IFS Projection like below. Variable “Identity” returns the current User-Id.

 

Hope this will help you 😊

Cheers!
Chamari


Asheer
Do Gooder (Partner)
Forum|alt.badge.img+2
  • Author
  • Do Gooder (Partner)
  • 4 replies
  • August 8, 2022

Hi @ChamariJ , 
Thank you for your response. 
However, I am unable to use the variable Identity returned by the read IFS Projection. 
The following error is generated.


You will find below my workflow design.

Is there a way to use the variable in the value field? 
Also, how did you know that the projection to use is Usersetting and the entity set name should be SingletonUser? Is there any Documentation to know where to get these values? 
Do you know if any supporting document/training is available concerning BPA Workflows? 
I have already covered the training session available on IFS Academy. However, it just gives a basic idea about workflows.
Thanks in advance,
Asheer.


ChamariJ
Sidekick (Partner)
Forum|alt.badge.img+4
  • Sidekick (Partner)
  • 6 replies
  • August 8, 2022

Hi Asheer,

Unfortunately I don’t have any idea about your E-Tag error 😥. Did you try to remove it and see? and please try to update with key in Customer LU.


Regarding the UserSettingProjection, I just searched for a projection call which returns the current logged in user and I found SingletonUser is having a where function to retrieve what I want.
 

I also followed the training sessions but could not find any ifs-technical documentation for this. I am using ifs cloud 21R2 and there are some interface changes rather than Aurena in BPA.

Thanks!
Chamari


eqbstal
Superhero (Partner)
Forum|alt.badge.img+21
  • Superhero (Partner)
  • 670 replies
  • August 18, 2022

Some documentation can be found here:

 


eqbstal
Superhero (Partner)
Forum|alt.badge.img+21
  • Superhero (Partner)
  • 670 replies
  • August 18, 2022

Less technical documentation is found here:

 


BawTrishM
Sidekick (Partner)
Forum|alt.badge.img+6
  • Sidekick (Partner)
  • 17 replies
  • October 1, 2022

Hi @ChamariJ ,

 

As discussed internally with @Asheer  the Etag error was actually a bug on our environment (21R1).
Upgrading to 22R1 solved the issue. We tested your solution and it works great. Thank you 🙂

 


Regards,

Trishen


ChamariJ
Sidekick (Partner)
Forum|alt.badge.img+4
  • Sidekick (Partner)
  • 6 replies
  • October 3, 2022

@BawTrishM ,

Thank you for confirming this. Since BPA is new to all of us Please share if you guys find new things in community 😊.

Cheers,

Chamari


eqbstal
Superhero (Partner)
Forum|alt.badge.img+21
  • Superhero (Partner)
  • 670 replies
  • April 25, 2023

With the projection set to Read UserSettings, in the above the SingletonUser is used as Entity Set Name, but one can also use Entity Set Name: CurrentPerson. This will return PersonId containing the Identity that one is looking for.

I think I'm too late to solve the issue of @Asheer, but might be useful somewhere in the future.


paul harland
Superhero (Employee)
Forum|alt.badge.img+24

Lahirumala de Mel
Hero (Employee)
Forum|alt.badge.img+7

Note that ifsBpaExecutionUserId internal input variable is deprecated in 24R1 and will be obsoleted in 24R2.

 

From 24R1 it is recommended to use following 2 new internal input variables.

  • ifsBpaCurrentUserDirectoryId - Holds the current directory ID.
    In some cases like SSO, the ifsBpaCurrentUserDirectoryId and the ifsBpaCurrentUserId are non-identical.

  • ifsBpaCurrentUserId - Holds the current user ID.


Forum|alt.badge.img+3
  • Do Gooder (Partner)
  • 17 replies
  • May 20, 2024
paul harland wrote:

 

Works only when triggered from Projection. If you trigger WF from button, there are not these variables.


Forum|alt.badge.img+6

A small warning regarding the use of ifsBpaCurrentUserId:

When I tried to use ifsBpaCurrentUserId, it unfortunately stored the user id in lowercase, for example: ‘makode’.
However, in the users tab, it appears as ‘MAKODE’ - in uppercase.

Is this a bug or intentional behavior? Version: 24r1



 


 


Forum|alt.badge.img+10
  • Hero (Partner)
  • 185 replies
  • November 21, 2024
KarelCZ wrote:
paul harland wrote:

 

Works only when triggered from Projection. If you trigger WF from button, there are not these variables.

Was this solved in any version that you can also get the current user id when you execute from a button?

 

@KarelCZ  ​@Lahirumala de Mel 


Forum|alt.badge.img+9
  • Hero (Employee)
  • 115 replies
  • November 22, 2024

These variables should be available even when WF triggered from button. This should work from 24R1 onwards 


Forum|alt.badge.img+3
  • Do Gooder (Partner)
  • 17 replies
  • November 22, 2024
kamnlk wrote:

These variables should be available even when WF triggered from button. This should work from 24R1 onwards 

I checked it now in version 24.1.5 and in Workflow Watch log there is only key parameter from page manually added in button definition.

 

 


Forum|alt.badge.img+9
  • Hero (Employee)
  • 115 replies
  • November 22, 2024

This variable is only available from inside the workflow execution. it does not show up on the observations 

eg:

you can refer to it inside the workflow as ${ifsBpaCurrentUserId} or execution.setVariable(“ifsBpaCurrentUserId”)


Forum|alt.badge.img+3
  • Do Gooder (Partner)
  • 17 replies
  • November 22, 2024

Thanks, I will try later. But when I run WF from projection, there are these parameters in observations.


eqbstal
Superhero (Partner)
Forum|alt.badge.img+21
  • Superhero (Partner)
  • 670 replies
  • February 15, 2025
kamnlk wrote:

This variable is only available from inside the workflow execution. it does not show up on the observations 

eg:

you can refer to it inside the workflow as ${ifsBpaCurrentUserId} or execution.setVariable(“ifsBpaCurrentUserId”)

@kamnlk Nice and I thought I could use something of this in IFS24R2. But I've tried:

and get the shown error. Most likely as there is no variable to assign it to. Error shown if inspection is done in design mode.

I tried execution.setVariable('Requestor’, "ifsBpaExecutionUserId”);

and ${Requestor} is used in Send Notification (next step after Set Variables). I get the error:

Which is totally logic to me.

Tried to remove the line execution.setVariable('Requestor’, "ifsBpaExecutionUserId”); in the Set Variables step. And in the Send Notification I have:

Which also makes sense to me as I didn't set the variable.

Is this due to the usage of Inspect?

Please show a working example.


Forum|alt.badge.img+9
  • Hero (Employee)
  • 115 replies
  • February 17, 2025

@eqbstal 

This variable is depicted on 24R1 and replaced on the 24R2 with ifsBpaCurrentUserDirectoryId. That may be the case you are seeing this behavior 

 

ref: IFS REST Call - Technical Documentation For IFS Cloud


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings