Help with formula to set value in Rules available for button - InfoPath Dev
in

InfoPath Dev

Help with formula to set value in Rules available for button

Last post 01-03-2011 08:23 AM by Greg Collins. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 01-02-2011 10:43 PM

    Help with formula to set value in Rules available for button

    Hi,

    I am using Infopath 2010. I selected the SharePoint list template.
    In the page, I have a textbox(it is set as field2), button and a rich textbox(it is set as field1).

    The requirement is, the user inputs the imagename in the textbox(that is field2) and clicks on the button. On the button click, i need to retrrieve the image from the picture library and show it in form. To display the picture, i have added the richtextbox and set it to readonly option.

    In the Rules for button, I have done the following:

    Action: Query for data - In the Data connection - receive data - selected the picture library, where the images are available.

    Action: Set a field's value - Field - I selected the richtextbox(that is field1).

    In the button, added rule like this:

    concat(SharePointsiteurl(),"PictureLibrary/",field2,".jpg")

    The above rule is working fine, if the image available inside the picture library.

    But, if the Image is inside some folder, then I am not able to retrieve the image.

    what should be set for the Value? I am not sure of using whiich formula to use and show the image. I need to show the image which matches the input given by the user.

    How to achieve this? Is the above method, which i done, is it correct?

    Thank you

     

     

  • 01-03-2011 08:23 AM In reply to

    Re: Help with formula to set value in Rules available for button

    You say that this works fine so long as teh image is in the library but not in a folder.

    Let's first assume that the folder is under "PictureLibrary". If that is the case, then this is a user-input issue. The user needs to not only enter the name of the image, but the folder. So instead of typing "picture1" they would need to type "folder3/picture1".

    Now if the folder is a sibling to "PictureLibrary" instead of a descendant, then the issue is with yoru concat() and the user input. In this case you would need to not concat "PictureLibrary" and the user will need to type in the complete folder path and picture name.

    Your concat() also assumes that all images will be of type ".jpg". Can you be certain that will always be the case and never ".png"?

Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.