<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: addDays() doesn't seem to work on external fields if I set filters</title><link>https://www.infopathdev.com:443/forums/thread/84878.aspx</link><pubDate>Thu, 29 Nov 2012 15:55:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84878</guid><dc:creator>davidstone789</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84878.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=84878</wfw:commentRss><description>&lt;p&gt;It makes perfect sense, and what&amp;#39;s more it worked perfectly!! Thank you so much - I shall remember this technique!&lt;/p&gt;</description></item><item><title>Re: addDays() doesn't seem to work on external fields if I set filters</title><link>https://www.infopathdev.com:443/forums/thread/84875.aspx</link><pubDate>Thu, 29 Nov 2012 15:08:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84875</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84875.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=84875</wfw:commentRss><description>&lt;p&gt;Oh, okay - these details are helpful. I think you need to repurpose another field in your secondary data connection - if you aren&amp;#39;t using the ID from the list for anything, you could use it. Put a rule on that field to set a field&amp;#39;s value, and use that rule to set each instance of your current dummy field in the repeating group to the filtered value. After your data loads initially (whether it is on a rule, form load, what have you) you can set ID to 0 - since ID will never be 0, this rule will set all instances to 0 (causing each instance to change values and fire the rule to set the dummy field with the filtered value). Does that make sense?&lt;/p&gt;</description></item><item><title>Re: addDays() doesn't seem to work on external fields if I set filters</title><link>https://www.infopathdev.com:443/forums/thread/84866.aspx</link><pubDate>Thu, 29 Nov 2012 09:01:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84866</guid><dc:creator>davidstone789</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84866.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=84866</wfw:commentRss><description>&lt;p&gt;Hi Hilary - thanks for your time :)&lt;/p&gt;
&lt;p&gt;Your workaround is exactly what I came up with too, but there&amp;#39;s a slight problem with it, namely that I am trying to display a different value on every row of my repeating section.&lt;/p&gt;
&lt;p&gt;In essence the external list is a list of meetings held. What I wanted to display is each meeting date plus a number of days - thus the &amp;#39;next meeting due&amp;#39;.&lt;/p&gt;
&lt;p&gt;So&amp;nbsp;a field in the main data connection wouldn&amp;#39;t help as I need to do the same calculation for each row.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What I tried instead was creating an additional collumn in my data source and using that field as a kind of dummy to hold my&amp;nbsp;filtered value, and then as you suggested, use the addDays function on the ready-filtered value. The problem then is how to set it. I tried setting it as a rule on the section, so it will run as each row is added, but it doesn&amp;#39;t seem to execute until I refresh the connection.&lt;/p&gt;</description></item><item><title>Re: addDays() doesn't seem to work on external fields if I set filters</title><link>https://www.infopathdev.com:443/forums/thread/84780.aspx</link><pubDate>Tue, 27 Nov 2012 15:22:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84780</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84780.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=84780</wfw:commentRss><description>&lt;p&gt;So - here&amp;#39;s my workaround. Add a field to the main data source. Set its default value to a calculated value - that would be the filtered XPath - &lt;strong&gt;&lt;em&gt;MyExternalField[. = UID] &lt;/em&gt;&lt;/strong&gt;or what have you.&lt;/p&gt;&lt;p&gt;Then, in the calculated value I was testing with, I used addDays with my new field (the one with the default value).... does that work in your circumstances?&lt;/p&gt;</description></item><item><title>Re: addDays() doesn't seem to work on external fields if I set filters</title><link>https://www.infopathdev.com:443/forums/thread/84779.aspx</link><pubDate>Tue, 27 Nov 2012 15:17:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84779</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84779.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=84779</wfw:commentRss><description>Oh wow - never mind what I just said - while the formula editor is not complaining, my form won&amp;#39;t open in preview - when I preview I get the same error you were getting!</description></item><item><title>Re: addDays() doesn't seem to work on external fields if I set filters</title><link>https://www.infopathdev.com:443/forums/thread/84778.aspx</link><pubDate>Tue, 27 Nov 2012 15:16:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84778</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84778.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=84778</wfw:commentRss><description>So, I just tried this - I added a caclulated value on a form, and used addDays with the field I&amp;#39;m adding to from a secondary data connection (a SharePoint list). I added a filter - that another field in my SharePoint list must be equal to a field in my form. I did not get an error from the formula editor. But I think you are saying that your filter uses a field from the 2ds you are using for the formula, and then compared to a field in another 2ds? Can you tick the Edit XPath box and post the full XPath for the formula you are trying?</description></item><item><title>Re: addDays() doesn't seem to work on external fields if I set filters</title><link>https://www.infopathdev.com:443/forums/thread/84777.aspx</link><pubDate>Tue, 27 Nov 2012 14:54:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84777</guid><dc:creator>davidstone789</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84777.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=84777</wfw:commentRss><description>&lt;p&gt;(Update: actually the same error occurs with a calculated value box &lt;em&gt;outside&lt;/em&gt; of the repeated section as well)&lt;/p&gt;</description></item><item><title>Re: addDays() doesn't seem to work on external fields if I set filters</title><link>https://www.infopathdev.com:443/forums/thread/84776.aspx</link><pubDate>Tue, 27 Nov 2012 14:52:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84776</guid><dc:creator>davidstone789</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84776.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=84776</wfw:commentRss><description>&lt;p&gt;There are a couple of relevent factors I should mention.&lt;/p&gt;
&lt;p&gt;The formula I am using is for a button label - although the same error occurs for a calculated value box.&lt;/p&gt;
&lt;p&gt;Also this is inside of a repeating section bound to a sharepoint list data connection, and when it queries the date field, that&amp;#39;s from a different sharepoint list data connection.&lt;/p&gt;</description></item><item><title>Re: addDays() doesn't seem to work on external fields if I set filters</title><link>https://www.infopathdev.com:443/forums/thread/84775.aspx</link><pubDate>Tue, 27 Nov 2012 14:42:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84775</guid><dc:creator>davidstone789</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84775.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=84775</wfw:commentRss><description>&lt;p&gt;Hi - thanks for responding.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve tried that just now, and yes it returns the value I expected.&lt;/p&gt;
&lt;p&gt;Worth noting that the error happens as I&amp;#39;m building the formula, rather than it simply not giving me what I want/expect at runtime.&lt;/p&gt;
&lt;p&gt;Could it be related to the data type of the field? It&amp;#39;s set in SharePoint as a date field, and within Infopath using just an expression box it gives the full date-and-time format, ie &amp;#39;2012-11-15T00:00:00&amp;#39; - could it be the inclusion of the time that&amp;#39;s making it fail?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m thinking not, because if I just run addDays on the field without a filter, it correctly adds my 30 days.&lt;/p&gt;
&lt;p&gt;Interestingly, elsewhere on the same form I am doing something similar - and it works! In other other scenario the key difference seems to be that I&amp;#39;m filtering based on the content of a local field in my form. So basically it;s like:-&lt;/p&gt;
&lt;p&gt;addDays(ExternalDateField[NameField = LocalFormField]) --------and that works just fine. However if instead of comparing it to the content of a field I just put a text value of &amp;quot;Joe Bloggs&amp;quot;, it brings back the afore-mentioned error.&lt;/p&gt;
&lt;p&gt;I can usually figure out a workaround to things like this, but in this case I&amp;#39;m not sure if I&amp;#39;m dealing with something I&amp;#39;m doing wrong or something Infopath isn&amp;#39;t doing right!&lt;/p&gt;</description></item><item><title>Re: addDays() doesn't seem to work on external fields if I set filters</title><link>https://www.infopathdev.com:443/forums/thread/84771.aspx</link><pubDate>Tue, 27 Nov 2012 13:23:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84771</guid><dc:creator>ErnestoM</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84771.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=84771</wfw:commentRss><description>&lt;p&gt;Could you put MyExternalListDateField[. = UID] on a calculated value to see if the filter is returning the value you expect it to return?&lt;/p&gt;&lt;p&gt;Maybe there&amp;#39;s something to fix in the filter?&lt;/p&gt;</description></item><item><title>addDays() doesn't seem to work on external fields if I set filters</title><link>https://www.infopathdev.com:443/forums/thread/84767.aspx</link><pubDate>Tue, 27 Nov 2012 11:55:05 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84767</guid><dc:creator>davidstone789</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84767.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=84767</wfw:commentRss><description>&lt;p&gt;So I&amp;#39;m pulling in a standard SharePoint list with one of the fields containing a date. I also have a &amp;#39;Unique ID&amp;#39;, and what I am trying to do is display the date from a specific record (matching the Unique ID) - but with 30 days added to it.&lt;/p&gt;
&lt;p&gt;So if I do &amp;#39;addDays(MyExternalListDateField, 30)&amp;#39; for example, that works - but of course without a filter it&amp;#39;s only going to call back the first item returned. So when I say it works, I mean that Infopath accepts it as a valid formula.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;If I then try &amp;#39;addDays(MyExternalListDateField[. = UID], 30)&amp;#39; (obviously I&amp;#39;m putting this in pseudo-code here for clarity) then Infopath tells me that &amp;quot;Function &amp;#39;AddDays&amp;#39; did not return a value, or it returned a value that cannot be converted to an XSL data type.&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Not being able to do this has put&amp;nbsp;a complete spanner into the works for what I was trying to achieve! Any pointers/ suggestions on how to get around this?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;</description></item></channel></rss>