Getting Data from SharePoint List

D

Dean

I have a Sharepoint list that contains an calculated field (it concatenates 2
other fields together). This calculate field is not available when I try to
use this list to populate a drop down list. Is this functionality unavailable
in InfoPath? If so, how can I concatenate 2 fields from a WSS list in a IP
dropdown control, or display 2 columns (like I can in Access)?

TIA
 
S

S.Y.M. Wong-A-Ton

I think it's by design. What you could do is add an extra (non-calculated)
field to your list in SharePoint and then use this field in InfoPath to store
the calculated values in and display them in the drop-down list box. Once you
have added the field in SharePoint and created a data connection in InfoPath,
you can retrieve the data connection in the OnLoad event handler of the form
and then do one of two things:
1. Loop through all the rows in the secondary data source and fill the extra
field with calculated values using the other fields in the same row, or
2. Create an XSLT that will transform each row in the secondary data source
to contain the calculated field based on the values of other fields within
the same row, and use this stylesheet to transform the entire secondary data
source in 1 step.

The advantage of the second option is that there isn't any looping involved
in code and it will perform better than the first option when you have many
rows to convert. I will post an example of the second option on my website.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top