How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask ATLPROG Your Own Question
ATLPROG
ATLPROG, Computer Software Engineer
Category: Programming
Satisfied Customers: 7677
Experience:  MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML
44910485
Type Your Programming Question Here...
ATLPROG is online now
A new question is answered every 9 seconds

I am looking with infopath All I want to do is add a

Customer Question

I am looking for help with infopath https://www.dropbox.com/s/zi1yz6rz6hk5yqz/exported%20files.xsn?dl=0 All I want to do is add a condition that states if the logged in user is not the main author hide the field Rewards & Recognition Disposition. I cannot
get this to work any clue what I am doing wrong? There are two conditions but cant get the second to work?
Submitted: 1 year ago.
Category: Programming
Expert:  Steve replied 1 year ago.

Hi there, my name is ***** ***** I can help you with your InfoPath problem. I downloaded the file you sent, but I can't open it because I don't have access to your server. Can you copy/paste the code you tried here and maybe we can troubleshoot it that way?

Customer: replied 1 year ago.
Can you right click the file and open in design?
Customer: replied 1 year ago.
All I am trying to do is I have a people picker called main author. I need to hide a section if the logged in user is not the main author. I do have both
getuserprofile and getgroupcollectionfromuser data connections. there is one condition there already but I need to add another
Expert:  Steve replied 1 year ago.

No, it won't let me open it at all because it requires domain permission level and has restricted permissions.

Expert:  Steve replied 1 year ago.

What's the condition that's there right now?

Customer: replied 1 year ago.
if user permissions does not contain group. This is based on getgroupcollection
Expert:  Steve replied 1 year ago.

what are the fields in your peoplepicker? For example, DisplayName, AccountID, AccountType

Customer: replied 1 year ago.
diplay name
account id
account type
Expert:  Steve replied 1 year ago.

Are you using GetUserProfileByName to get the current user's name?

Customer: replied 1 year ago.
Expert:  Steve replied 1 year ago.

So you should compare the PeoplePicker DisplayName and the result of the GetUserProfileByName to see if they are equal.

Customer: replied 1 year ago.
how do I do that? Can you give me example
Customer: replied 1 year ago.
what do I select in the getuserprofile
Expert:  Steve replied 1 year ago.

hold on a second, i'm trying to write something out for you

Expert:  Steve replied 1 year ago.

Are you including DisplayName in your rule for the peoplepicker?

Customer: replied 1 year ago.
I am not sure what you mean
Expert:  Steve replied 1 year ago.

What do you have as the default value for DisplayName and AccountID?

Customer: replied 1 year ago.
I dont think that I have a default value set
Customer: replied 1 year ago.
for the getuserprofile account name is = to username
Expert:  Steve replied 1 year ago.

Not the account name, the display name

Expert:  Steve replied 1 year ago.

getUserProfileByName

Customer: replied 1 year ago.
nothing for diplay name right now
Expert:  Steve replied 1 year ago.

are you using getUserProfileByName ?

Customer: replied 1 year ago.
I am
Expert:  Steve replied 1 year ago.

So what's in your peoplepicker? Name or username?

Customer: replied 1 year ago.
The people picker. the employee needs to enter name it is not auto populate.
Expert:  Steve replied 1 year ago.

and the employee enters a username, which should be the same as the account name in getuserprofile?

Customer: replied 1 year ago.
when user enters in it displays asD
Customer: replied 1 year ago.
when user enters name is ***** ***** debbie smith
Expert:  Steve replied 1 year ago.

so the user types in "debbie smith" or types in her username and it displays as "debbie smith"?

Customer: replied 1 year ago.
types name
Expert:  Steve replied 1 year ago.

Is that the same as her username? Because you said you were trying to compare it to the GetUserProfile account name, which is the username

Customer: replied 1 year ago.
no user names are ***** ***** format
Expert:  Steve replied 1 year ago.

So you can't compare them because they won't be equal. Is "Debbie Smith" what you get back from GetUserProfileByName?

Customer: replied 1 year ago.
I have created the getuser profile by name but have not used it yet. The other condition is based on getgroupcollection from user
Customer: replied 1 year ago.
what can I screen shot for you to make it easier
Expert:  Steve replied 1 year ago.

The Action rules?

Expert:  Steve replied 1 year ago.

I think part of the problem is that you're trying to compare two different things. When you use GetGroupCollectionFromUser, you get the userLoginName, right? But when the user types her information into the people picker, she's typing her name, not her username.

Customer: replied 1 year ago.
That is correct
Customer: replied 1 year ago.
take a look at thishttps://www.dropbox.com/s/tvu46kbrdo78g72/Test.docx?dl=0
Expert:  Steve replied 1 year ago.

Thanks for that. But do you see the issue that you're retrieving username from GetGroupCollectionFromUser and trying to compare it to a person's name that she types in the PeoplePicker, so they will never match. Instead of GetGroupCollectionFromUser, can you use GetUserProfileByName and will the result be the same thing that the person types in the PeoplePicker?

Customer: replied 1 year ago.
That is pulling from a group on sharepoint. So if the user is in this group they will see section or if they are the main author. I
Customer: replied 1 year ago.
dont know a way around that
Expert:  Steve replied 1 year ago.

If you want to show something only if the person is the main author, you need to have two fields that exactly match: name and name or username and username. otherwise you can't do it.

Customer: replied 1 year ago.
Okay so lets say that the group collection is gone how do I to hide field based on the main author
Customer: replied 1 year ago.
I guess
Customer: replied 1 year ago.
I understand why it is not working I just dont know how to fix it
Expert:  Steve replied 1 year ago.

I'm sorry, I don't know how you could fix it either. You have to some way get two fields that will be exactly the same when the logged on user is the main author.

Customer: replied 1 year ago.
ecause if the main autor is pulling
displayname
account id
accounttypeand getuser profile is pulling account nameso frustrating there has to be a way to get this to work
Expert:  Steve replied 1 year ago.

i'm sorry, i'll opt out to see if someone else can help you.

Expert:  Chris Baxter replied 1 year ago.

It sounds as if there is an easy fix to this, but it will require some setup. First, you will need a way to expose the "author" data and then compare that data to the user logged in. You can try adding a dummy "currentUser" field to a section and see who the form thinks is opening it, and that will help with your formatting rule. Normally the could put the field in a section, and only show it when X people view/open the form, that is close but not quite what you are trying to do from my understanding, and it will require a bit of a workaround to create a validation that IDs the current user, compares that user to the author of the form/data, and performs the action. As far as I know there is no easy way to do this, except possibly populating a hidden field with "author" data, then comparing that prepop field with the "currentUser" field, as long as the formats of the data match. (You cannot compare dates with different formats, for example. ((12/24/2015 vs. 20151224)) The same is true with names and user names. If your format is ((FirstName LastName)) then you cannot compare a field with the format ((LastName, FirstName)). You will need to find two fields in the proper dataset that are comparable before continuing this project.

Customer: replied 1 year ago.
Funny you should say that as I did this one displays fg639m other displays as
as I:0#.w|site\fg639m
How can I correct that
Expert:  Chris Baxter replied 1 year ago.

It is possible to do that! Please see the following link for instructions, and let me know if you need further assistance! :)

http://melick-rajee.blogspot.com/2012/02/how-to-set-current-user-name-to.html

Customer: replied 1 year ago.
I am receiving sp13_webappspool error
Expert:  Chris Baxter replied 1 year ago.

To start, do all default starting values have an actual value set? For example, empty field for numbers set to 0, etc?

Customer: replied 1 year ago.
I believe so. In preview mode it works fine once it goes to share point that's when I receive the error
Expert:  Chris Baxter replied 1 year ago.

Ok, have you set up application pools or have any preset ones in IIS?

Customer: replied 1 year ago.
This is set up by a different team should I contact them. I don't have access to Central admin however I am an administrator
Expert:  Chris Baxter replied 1 year ago.

Follow this link to check that out, it seems the linkage between the server and the program is not quite set up fully, or has an error in configuration. Here is a link that may assist in that setup if you have not already completed it.

http://www.iis.net/configreference/system.applicationhost/applicationpools

Yes, it would likely be a setup and configuration issue on the application pool itself. Contacting the administrator would be a good idea. :)

Expert:  Chris Baxter replied 1 year ago.

If you have any further questions, please feel free to ask!