Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set Field #1582

Closed
Closed

Conversation

TechnologistTim
Copy link
Contributor

This will populate a <u_location> field string based on the field on the user's record without having to use GlideAjax. Go to the <u_location> dictionary and place this snippet in the Default Value field.

@sandeepd26 sandeepd26 self-assigned this Oct 31, 2024
@sandeepd26
Copy link

Hi @TechnologistTim ,
Are you asking to put this condition as a flow action?

@SapphicFire SapphicFire self-assigned this Oct 31, 2024
Copy link
Contributor

@SapphicFire SapphicFire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your contribution. However, it doesn’t comply with our contributing guidelines. As a reminder, the general requirements (as outlined in the CONTRIBUTING.md file) are the following: follow the folder+subfolder guidelines and include a readme.md file explaining what the code snippet does. Review your contribution against the guidelines and make the necessary adjustments. Closing this for now. Once you make additional changes, feel free to re-open this Pull Request or create a new one.

@@ -0,0 +1 @@
javascript: var luser = new GlideRecord("sys_user"); luser.get("sys_id", gs.getUserID()); luser.location.u_installation_id.sys_id.toString();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This call type would not be suitable in a flow action. Additionally, you should use getUniqueValue() to get the sys_id string

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works flawlessly on our production instance as is. I did mean to add this to Dynamic Filter though, not Flow Action.

@@ -0,0 +1 @@
This will populate a <u_location> field string based on the <location> field on the user's record without having to use GlideAjax. Go to the <u_location> dictionary and place this snippet in the Default Value field.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalid file type, u_installation_id from the script is not documented, and this readme does not describe much at all

Copy link
Contributor Author

@TechnologistTim TechnologistTim Oct 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I looked at another readme from someone else and thought I followed what they did. I'll add more detail.

As for the filetype, I followed the contribution file but for a newb like me, it doesn't provide the level of detail I need. I simply added a file as it states and typed away.

As for the field. I'm going to add in the Readme this applies to a reference field that is added. "u_installation" being the name of my particular field. The <> was an attempt to an example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants